{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from Bio.PDB.MMCIFParser import MMCIFParser\n",
    "parser = MMCIFParser()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "structure = parser.get_structure('1h10', '1h10.cif')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Structure id=1h10>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "structure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['__class__',\n",
       " '__contains__',\n",
       " '__delattr__',\n",
       " '__delitem__',\n",
       " '__dict__',\n",
       " '__dir__',\n",
       " '__doc__',\n",
       " '__eq__',\n",
       " '__format__',\n",
       " '__ge__',\n",
       " '__getattribute__',\n",
       " '__getitem__',\n",
       " '__gt__',\n",
       " '__hash__',\n",
       " '__init__',\n",
       " '__init_subclass__',\n",
       " '__iter__',\n",
       " '__le__',\n",
       " '__len__',\n",
       " '__lt__',\n",
       " '__module__',\n",
       " '__ne__',\n",
       " '__new__',\n",
       " '__reduce__',\n",
       " '__reduce_ex__',\n",
       " '__repr__',\n",
       " '__setattr__',\n",
       " '__sizeof__',\n",
       " '__str__',\n",
       " '__subclasshook__',\n",
       " '__weakref__',\n",
       " '_generate_full_id',\n",
       " '_id',\n",
       " '_reset_full_id',\n",
       " 'add',\n",
       " 'child_dict',\n",
       " 'child_list',\n",
       " 'copy',\n",
       " 'detach_child',\n",
       " 'detach_parent',\n",
       " 'full_id',\n",
       " 'get_atoms',\n",
       " 'get_chains',\n",
       " 'get_full_id',\n",
       " 'get_id',\n",
       " 'get_iterator',\n",
       " 'get_level',\n",
       " 'get_list',\n",
       " 'get_models',\n",
       " 'get_parent',\n",
       " 'get_residues',\n",
       " 'has_id',\n",
       " 'header',\n",
       " 'id',\n",
       " 'insert',\n",
       " 'level',\n",
       " 'parent',\n",
       " 'set_parent',\n",
       " 'transform',\n",
       " 'xtra']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(structure)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Residue THR het=  resseq=100 icode= >"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "structure[0]['A'][100]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "357"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(structure[0]['A'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<Residue ARG het=  resseq=15 icode= >\n",
      "1\n",
      "<Residue SER het=  resseq=56 icode= >\n",
      "1\n",
      "<Residue MSE het=H_MSE resseq=63 icode= >\n",
      "1\n",
      "<Residue ILE het=  resseq=75 icode= >\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "for i in structure[0]['A']:\n",
    "    if i.disordered == 1:\n",
    "        print(i)\n",
    "        print(i.disordered)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Residue ARG het=  resseq=15 icode= >"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "residue = structure[0]['A'][15]\n",
    "residue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('1h10', 0, 'A', (' ', 15, ' '))"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "residue.get_full_id()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<Atom N>,\n",
       " <Atom CA>,\n",
       " <Atom C>,\n",
       " <Atom O>,\n",
       " <Atom CB>,\n",
       " <Atom CG>,\n",
       " <Atom CG>,\n",
       " <Atom CD>,\n",
       " <Atom CD>,\n",
       " <Atom NE>,\n",
       " <Atom NE>,\n",
       " <Atom CZ>,\n",
       " <Atom CZ>,\n",
       " <Atom NH1>,\n",
       " <Atom NH1>,\n",
       " <Atom NH2>,\n",
       " <Atom NH2>]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "residue.get_unpacked_list()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
